<?php
namespace Home\Model;
use Think\Model;
use Common\Library\Category;
class NavigationModel extends Model{
	public function getNavigations($data){
		$map=array(
			'language_id'	=>	get_default_lng_id(),
			'status'		=>	1
			);
		$order='sort_order ASC';
		$navigations=$this->join('LEFT JOIN  __NAVIGATION_DESCRIPTION__ ON __NAVIGATION__.navigation_id=__NAVIGATION_DESCRIPTION__.navigation_id')->where($map)->field(C('DB_PREFIX')."navigation.navigation_id,title,href,parent_id,target")->order($order)->select();
		foreach ($navigations as &$v) {
			$v['url']=U($v['href']);
		}
		unset($v);
		return Category::unlimitedForLayer($navigations, 'child', 0,'navigation_id','parent_id');
	}	
}